package base;

import java.util.Scanner;

public class BASIC4 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int max = sc.nextInt();
		int min = max;
		int sum = max;
		for(int i = 1; i < n; i++) {
			int val = sc.nextInt();
			max = Math.max(max, val);
			min = Math.min(min, val);
			sum += val;
		}
		System.out.println(max);
		System.out.println(min);
		System.out.println(sum);
		sc.close();
	}
}
